<extend name="template/base_index" />

<block name="area_header">
    <link rel="stylesheet" href="__CSS__/apply_money.css">
</block>

<block name="area_body">
    <div class="common_head">
        <a href="{:U('UserCenter/apply_money')}"><i class="fa fa-chevron-left"></i></a>
    </div>
    <form id="moneyform" action="{:U('Account/apply_money')}" method="post">
        <input type="hidden" id="hasmoney" value="{$money}"/>
        <div class="apply_top" style="padding:15px;border-bottom: 1px solid #d9d9d9;"><div class="apply_tname">余额：<span class="stay_money" style="color:#d14"><i class="fa fa-jpy"></i>{$money}</span></div></div>
        <div class="weui_cells weui_cells_form" style="margin-top:0;margin-bottom: 20px;">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">账户名称</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入拥有人名称" name="account_name">
                </div>
            </div>
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">提现账号</label></div>
                <div class="weui_cell_bd weui_cell_primary" style="display:flex">
                    <input class="weui_input account_in" type="text" name="account" placeholder="支付宝账户"><i class="appliy_ico fa fa-pencil-square-o"></i>
                </div>
            </div>
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">提现金额</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="number" placeholder="请输入提现金额" name="money">
                </div>
            </div>
        </div>
        <a onclick="formsubmit()" class="weui_btn weui_btn_warn sure-button">确定</a>
    </form>
    <script src="__JS__/jquery-weui.min.js"></script>
    <script type="text/javascript">

            function formsubmit(){
                var money = $('#hasmoney').val();
                if($("[name = 'account']").val() == ''){
                    $.toptip('提现账户填写有误', 'warning');
                }else if($("[name = 'money']").val() == '' || parseFloat($("[name = 'money']").val()) > parseFloat(money)||$("[name = 'money']").val() <= '0'){
                    $.toptip('提现金额有误', 'warning');
                }else{
                    $('#moneyform').submit();
                }
            }

    </script>
</block>